import { useSelector } from 'react-redux';
import {useParams} from 'react-router-dom'
export default function PostDetail({ title, content,match }) {
  const {id} = useParams()
   const post = useSelector(state => state.posts.find(post =>post.id===id))
    
  return (
    <>
      <div>
        <article className="post-excerpt">
          <h3>{post.title}</h3>
          <p className="post-content">{post.content}</p>
        </article>
      </div>
    </>
  );
}
